#ifndef _DevicesADC_H_
#define _DevicesADC_H_

#include "soc/adc_periph.h"
#include "driver/gpio.h"
#include "driver/adc.h"
#include "hal/adc_hal.h"
#include "hal/adc_ll.h"


typedef enum {
    /* 输出电压 */
    ADC_DMA_VOLTAGE_OUT = 0,
    /* 输出电流 */
    ADC_DMA_CURRENT_OUT,

    /* 最大的通道值 */
    ADC_DMA_SCAN_MAX,
} AdcDmaChannelEnum;


/* 采样扫描通道数量 */
#define ADC0_SAMPLING_CHANNEL           ADC_DMA_SCAN_MAX
/* 每通道采样次数 */
#define ADC0_SAMPLING_NUMBER            8
/* 采样时间 */
#define ADC0_SAMPLE_TIME                (3 << 4)


void vADCInit(void);
float fADCGetDMAValue(AdcDmaChannelEnum enumChannel);
int32_t iADCGetDMAValue(AdcDmaChannelEnum enumChannel);

float fADCGetChannelValue(uint8_t channel, uint32_t uiCnt);
int32_t iADCGetChannelValue(uint8_t channel, uint32_t uiCnt);


#endif
